<%@page import="com.kensure.shike.sys.model.SKDict"%>
<%@page import="java.util.List"%>
<%@page import="com.kensure.shike.sys.service.SKDictService"%>
<%@page import="com.kensure.shike.constant.BusiConstant"%>
<%@page import="co.kensure.api.ApiUtil"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
<jsp:include page="base/header.jsp" flush="true"> 
 <jsp:param value="消息管理" name="pageTitle"/>
</jsp:include>

<!--必要样式-->
<link rel="stylesheet" href="<%=BusiConstant.context%>/common/css/style.css" type="text/css" />
<body>
<jsp:include page="base/nav.jsp" flush="true"></jsp:include>

<% %>

<h2 style="padding-left: 20px; padding-top: 30px; padding-bottom: 30px">信息收集</h2>
<div id="content" style="margin-left:20px;font-size:12px;">
    <div >
        <div>	
         	<table id="headtable">
         		<thead></thead>
             	<tbody></tbody>
            </table>
        </div>
        <div id="fanye"></div>
    </div>
</div>

</body>



<script>
	var table = createtable("headtable");
	
	var optfun = function(row){
		var tdinner = ""; 
		tdinner += "<button type='button' class='self-btn' onclick='add("+row.id+")'>详情</button>";
		tdinner += "<button type='button' class='self-btn' onclick='del("+row.id+")'>删除</button>";
		return tdinner;
	}

	
	var imgtdfun = function(row){
		var tdinner = "<img style='width:100px;height:100px;' src='"+row.picurl+"'>";
		return tdinner;
	}
	
	
	table.th = [{w:100,na:"编号",colname:"id"}
	,{w:300,na:"公司名称",colname:"companyName"}
	,{w:100,na:"公司地址",colname:"companyAddress"}
	,{w:300,na:"联系人",colname:"contact"}
	,{w:100,na:"联系电话",colname:"tel"}
	,{w:200,na:"操作",callfun:optfun}];
	
	table.thinit();
	
	function sucdo(data){
		var rows = data.resultData.rows;
		fanye.init(data.resultData.total);	
		if(rows){	
			table.data = rows;
			table.tdinit();		
		}	
	}

	var fanye = new FanYe("fanye","huodonglist",0,20,1);
	
   function huodonglist(current){
	   if(!fanye.setpage(current)){
			return;
		}
	   var data = {pageNo:fanye.current,pageSize:fanye.limit};
	   var url = getbaseurl("/collect/list.do");
	   postdo(url, data, sucdo,null, null);
   }
   huodonglist(1);
   
   
   function doSearch(){
	   huodonglist(fanye.current);
   }
   
   function del(id){
	   if(confirm('确认删除？')){
		   var data = {id:id};
		   var url = getbaseurl('/collect/del.do');
		   postdo(url, data, function(data){
			   doSearch();
		   },null, null);
	   }	
   }
   
   function add(id){  
	   var addurl = getbaseurl('/ht/collectdetail');
	   if(id){
			addurl+="?id="+id; 
	   }
	   layer.open({
			type: 2,
			title: '商品修改',
			maxmin: true,
			shadeClose: false, //点击遮罩关闭层
			area : ['80%' , '80%'],
			content: addurl
	   });
   }
     
</script>


</html>